package cn.edu.neusoft.wuguangsheng.market.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import java.util.List;

import cn.edu.neusoft.wuguangsheng.market.bean.ShowCartBean;

/**
 * Created by little on 2018/4/16.
 */

public class ShowCartAdapter extends BaseAdapter<ShowCartBean> {

    public ShowCartAdapter(Context context, List<ShowCartBean> items, int layoutResource){
        super(context, items, layoutResource);
    }
        @Override
        public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View itemView= LayoutInflater.from(context)
                .inflate(layoutResourse,parent,false);
        CartViewHolder cartViewHolder=new CartViewHolder(itemView);
        return cartViewHolder;
    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
//        CartViewHolder cartViewHolder=(CartViewHolder) holder;
//
//        ShowCartBean showCartBean=items.get(position);
//        final String name=showCartBean.getName();
//        cartViewHolder.cart_tv1.setText(name);
//        final String num=showCartBean.getNum();
//        cartViewHolder.cart_tv2.setText(num);
//        final double sum=showCartBean.getSum();
//        String sum1=String.valueOf(sum);
//        cartViewHolder.cart_tv3.setText(sum1);
//        Picasso.with(context).load(items.get(position).getPic()).resize(90,50).centerCrop().into(cartViewHolder.cart_img);
//        cartViewHolder.cart_delect.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//
//            }
//        });
    }
}
